package com.yc.psychologicalconsultant.service.impl;

import com.yc.psychologicalconsultant.service.EmailService;
import com.yc.psychologicalconsultant.utils.MailUtil;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Service;

/**
 * @author YC
 * @version 1.0
 */
@Service
@Data
@ConfigurationProperties(prefix = "email")
public class EmailServiceImpl implements EmailService {

    private String emailUser;

    private String emailPassword;

    @Override
    public void mail(String email, String username, String title, String verification) throws Exception {
        MailUtil.mail(email,username,title,verification,emailUser,emailPassword);
    }
}
